Conventionally, image frames are rendered to allow display thereof by a display device. For example, a 3-dimensional (3D) virtual world of a video game may be rendered to 2-dimensional (2D) perspective correct image frames. In any case, the time to render each image frame (i.e. the rendering rate of each frame) is variable as a result of such rendering time depending on the number of objects in the scene represented by the image frame, the number of light sources, the camera viewpoint/direction, etc. Unfortunately, the refresh of a display device has generally been independent of the rendering rate, which has resulted in limited schemes being introduced that attempt to compensate for any discrepancies between the differing rendering and display refresh rates.
Just by way of example, a vsync-on mode and a vsync-off mode are techniques that have been introduced to compensate for any discrepancies between the differing rendering and display refresh rates. In practice these modes have been used exclusively for a particular application, as well as in combination where the particular mode selected can be dynamically based on whether the GPU render rate is above or below the display refresh rate. In any case though, vsync-on and vsync-off have exhibited various limitations.
FIG. 1A shows an example of operation when the vsync-on mode is enabled. As shown, an application (e.g. video game) uses a double-buffering approach, in which there are two buffers in memory to receive frames, buffer ‘A’ and ‘B’. In the present example, the display is running at 60 Hz (16.6 mS period). The GPU sends a frame across the cable to the display after the display ‘vertical sync’ (vsync). At time ‘t2’, frame ‘i’ rendering is not yet complete, so the display cannot yet show frame ‘i’. Instead the GPU sends frame ‘i−1’ again to the display. Shortly after ‘t2’, the GPU is done rendering frame ‘i’. The GPU goes into a wait state, since there is no free buffer to render an image into, namely buffer B is in use by the display to scan out pixels, and buffer A is filled and waiting to be displayed. Just before ‘t3’ the display is done scanning out all pixels, and buffer B is free, and the GPU can start rendering frame ‘i+1’ into buffer B. At ‘t3’ the GPU can start sending frame ‘i’ to the display.
Note that when the rendering of a frame completes just after vsync, this can cause an extra 15 mS to be added before the frame is first displayed. This adds to the ‘latency’ of the application, in particular the time between a user action such as a ‘mouse click’, and the visible response on the screen, such as a ‘muzzle flash’ from the gun. A further disadvantage of ‘vsync-on’ is that if the GPU rendering happens to be slightly slower than 60 Hz, the effective refresh rate will drop down to 30 Hz, because each image is shown twice. Some applications allow the use of ‘triple buffering’ with ‘vsync-on’ to prevent this 30 Hz issue from occurring. Because the GPU never needs to wait for a buffer to become available in this particular case, the 30 Hz refresh issue is avoided. However, the display pattern of ‘new’, ‘repeat’, ‘new’, ‘new’, ‘repeat’ can make motion appear irregular. Moreover, when the GPU renders much faster than display, triple buffering actually leads to increased latency of the application running on the GPU.
FIG. 1B shows an example of operation when the vsync-off mode is enabled. As shown, in the present example the display is again running at 60 Hz. In the vsync-off case, the GPU starts sending the pixels of a frame to the display as soon as the rendering of the frame completes, and abandons sending the pixels from the earlier frame. This immediately frees the buffer in use by the display and the GPU need not wait to start rendering the next frame. The advantage of vsync-off is lower latency, and faster rendering (no GPU wait). One disadvantage of ‘vsync-off’ is so called ‘tearing’, where the screen shown to the user contains a horizontal ‘tear line’ where the newly available rendered frame begins being written to the display due to object motion that puts objects of the earlier frame in a different position in the new frame. The tear line is especially noticeable when objects in the rendered scene are moving (or the scene is being panned) and part of an image of an object is above the tear line and part of the image of the object is below the tear line. In this case the object appears to be torn—the top of the object is in the wrong position relative to the bottom of the object. In this context, “tearing” is similar to the word “ripping” and not the word “weeping”.
There is thus a need for addressing these and/or other issues associated with the prior art.